package com.alibaba.nacos.naming.core.v2.client;

import com.alibaba.nacos.naming.core.v2.pojo.InstancePublishInfo;
import com.alibaba.nacos.naming.core.v2.pojo.Service;
import com.alibaba.nacos.naming.pojo.Subscriber;

import java.util.Collection;

public interface Client {
    boolean addServiceInstance(Service service,
                               InstancePublishInfo instancePublishInfo);

    void setLastUpdatedTime();

    long recalculateRevision();

    String getClientId();

    InstancePublishInfo getInstancePublishInfo(Service service);

    Collection<Service> getAllPublishedService();

    boolean isEphemeral();

    Subscriber getSubscriber(Service service);

    boolean addServiceSubscriber(Service usingService,
                                 Subscriber subscriber);

    InstancePublishInfo removeServiceInstance(Service service);

    ClientSyncData generateSyncData();

    boolean removeServiceSubscriber(Service usingService);

    void setRevision(long revision);

    boolean isExpire(long currentTime);
}
